package jee.boot.common.dao;

import jee.boot.common.basic.CrudDao;
import jee.boot.entity.system.SerialNumber;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SerialNumberDao extends CrudDao<SerialNumber> {
    @Update("UPDATE ${tableName} SET\n" +
            "        version=#{version},\n" +
            "        serial_number=#{serialNumber},\n" +
            "        data_cycle=#{dataCycle}\n" +
            "        where id=#{id} and version=#{oldVersion}")
    boolean checkAndUpdateVersionAndStatus(SerialNumber serialNumber);
}
